<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-name-shadowing #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE MagicHash #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE UnboxedTuples #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE RecordWildCards #-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">--  (c) The University of Glasgow 2002-2006</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-comment">-- | Create real byte-code objects from 'ResolvedBCO's.</span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHCi.CreateBCO</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.CreateBCO.html#createBCOs"><span class="hs-identifier">createBCOs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-comment">-- See note [Why do we import Prelude here?]</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHCi.ResolvedBCO.html"><span class="hs-identifier">GHCi.ResolvedBCO</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHCi.RemoteTypes.html"><span class="hs-identifier">GHCi.RemoteTypes</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHCi.BreakArray.html"><span class="hs-identifier">GHCi.BreakArray</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="SizedSeq.html"><span class="hs-identifier">SizedSeq</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.IO.html#fixIO"><span class="hs-identifier">fixIO</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.Base.html#"><span class="hs-identifier">Data.Array.Base</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.html#"><span class="hs-identifier">Foreign</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Foreign.Marshal.Array.html#newArray"><span class="hs-identifier">newArray</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Unsafe.Coerce.html#"><span class="hs-identifier">Unsafe.Coerce</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce"><span class="hs-identifier">unsafeCoerce</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Arr.html#"><span class="hs-identifier">GHC.Arr</span></a></span><span>          </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Arr.html#Array"><span class="hs-identifier">Array</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exts.html#"><span class="hs-identifier">GHC.Exts</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#"><span class="hs-identifier">GHC.IO</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.html#ErrorCall"><span class="hs-identifier">ErrorCall</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="annot"><a href="GHCi.CreateBCO.html#createBCOs"><span class="hs-identifier hs-type">createBCOs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCO"><span class="hs-identifier hs-type">ResolvedBCO</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHCi.RemoteTypes.html#HValueRef"><span class="hs-identifier hs-type">HValueRef</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-33"></span><span id="createBCOs"><span class="annot"><span class="annottext">createBCOs :: [ResolvedBCO] -&gt; IO [HValueRef]
</span><a href="GHCi.CreateBCO.html#createBCOs"><span class="hs-identifier hs-var hs-var">createBCOs</span></a></span></span><span> </span><span id="local-6989586621679096678"><span class="annot"><span class="annottext">[ResolvedBCO]
</span><a href="#local-6989586621679096678"><span class="hs-identifier hs-var">bcos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-34"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679096675"><span class="annot"><span class="annottext">n_bcos :: Int
</span><a href="#local-6989586621679096675"><span class="hs-identifier hs-var hs-var">n_bcos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ResolvedBCO] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[ResolvedBCO]
</span><a href="#local-6989586621679096678"><span class="hs-identifier hs-var">bcos</span></a></span><span>
</span><span id="line-35"></span><span>  </span><span id="local-6989586621679096673"><span class="annot"><span class="annottext">[HValue]
</span><a href="#local-6989586621679096673"><span class="hs-identifier hs-var">hvals</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">([HValue] -&gt; IO [HValue]) -&gt; IO [HValue]
forall a. (a -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/System.IO.html#fixIO"><span class="hs-identifier hs-var">fixIO</span></a></span><span> </span><span class="annot"><span class="annottext">(([HValue] -&gt; IO [HValue]) -&gt; IO [HValue])
-&gt; ([HValue] -&gt; IO [HValue]) -&gt; IO [HValue]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096672"><span class="annot"><span class="annottext">[HValue]
</span><a href="#local-6989586621679096672"><span class="hs-identifier hs-var">hvs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-36"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679096665"><span class="annot"><span class="annottext">arr :: Array Int HValue
</span><a href="#local-6989586621679096665"><span class="hs-identifier hs-var hs-var">arr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int, Int) -&gt; [HValue] -&gt; Array Int HValue
forall (a :: * -&gt; * -&gt; *) e i.
(IArray a e, Ix i) =&gt;
(i, i) -&gt; [e] -&gt; a i e
</span><a href="../../array/src/Data.Array.Base.html#listArray"><span class="hs-identifier hs-var">listArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096675"><span class="hs-identifier hs-var">n_bcos</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[HValue]
</span><a href="#local-6989586621679096672"><span class="hs-identifier hs-var">hvs</span></a></span><span>
</span><span id="line-37"></span><span>     </span><span class="annot"><span class="annottext">(ResolvedBCO -&gt; IO HValue) -&gt; [ResolvedBCO] -&gt; IO [HValue]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array Int HValue -&gt; ResolvedBCO -&gt; IO HValue
</span><a href="GHCi.CreateBCO.html#createBCO"><span class="hs-identifier hs-var">createBCO</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096665"><span class="hs-identifier hs-var">arr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ResolvedBCO]
</span><a href="#local-6989586621679096678"><span class="hs-identifier hs-var">bcos</span></a></span><span>
</span><span id="line-38"></span><span>  </span><span class="annot"><span class="annottext">(HValue -&gt; IO HValueRef) -&gt; [HValue] -&gt; IO [HValueRef]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">HValue -&gt; IO HValueRef
forall a. a -&gt; IO (RemoteRef a)
</span><a href="GHCi.RemoteTypes.html#mkRemoteRef"><span class="hs-identifier hs-var">mkRemoteRef</span></a></span><span> </span><span class="annot"><span class="annottext">[HValue]
</span><a href="#local-6989586621679096673"><span class="hs-identifier hs-var">hvals</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="annot"><a href="GHCi.CreateBCO.html#createBCO"><span class="hs-identifier hs-type">createBCO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCO"><span class="hs-identifier hs-type">ResolvedBCO</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span><span>
</span><span id="line-41"></span><span id="createBCO"><span class="annot"><span class="annottext">createBCO :: Array Int HValue -&gt; ResolvedBCO -&gt; IO HValue
</span><a href="GHCi.CreateBCO.html#createBCO"><span class="hs-identifier hs-var hs-var">createBCO</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array Int HValue
</span><span class="hs-identifier">_</span></span><span>   </span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCO"><span class="hs-identifier hs-type">ResolvedBCO</span></a></span><span class="hs-special">{</span><span id="local-6989586621679096654"><span id="local-6989586621679096655"><span id="local-6989586621679096656"><span id="local-6989586621679096657"><span id="local-6989586621679096658"><span id="local-6989586621679096659"><span class="annot"><span class="annottext">Bool
Int
UArray Int Word16
UArray Int Word64
SizedSeq ResolvedBCOPtr
resolvedBCOPtrs :: ResolvedBCO -&gt; SizedSeq ResolvedBCOPtr
resolvedBCOLits :: ResolvedBCO -&gt; UArray Int Word64
resolvedBCOIsLE :: ResolvedBCO -&gt; Bool
resolvedBCOInstrs :: ResolvedBCO -&gt; UArray Int Word16
resolvedBCOBitmap :: ResolvedBCO -&gt; UArray Int Word64
resolvedBCOArity :: ResolvedBCO -&gt; Int
resolvedBCOPtrs :: SizedSeq ResolvedBCOPtr
resolvedBCOLits :: UArray Int Word64
resolvedBCOBitmap :: UArray Int Word64
resolvedBCOInstrs :: UArray Int Word16
resolvedBCOArity :: Int
resolvedBCOIsLE :: Bool
</span><a href="GHCi.ResolvedBCO.html#resolvedBCOPtrs"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679096659"><span class="hs-identifier hs-var">resolvedBCOIsLE</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHCi.ResolvedBCO.html#isLittleEndian"><span class="hs-identifier hs-var">isLittleEndian</span></a></span><span>
</span><span id="line-42"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrorCall -&gt; IO HValue
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ErrorCall
</span><a href="../../base/src/GHC.Exception.html#ErrorCall"><span class="hs-identifier hs-var">ErrorCall</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ErrorCall) -&gt; String -&gt; ErrorCall
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="../../base/src/Data.OldList.html#unlines"><span class="hs-identifier hs-var">unlines</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The endianness of the ResolvedBCO does not match&quot;</span></span><span>
</span><span id="line-44"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the systems endianness. Using ghc and iserv in a&quot;</span></span><span>
</span><span id="line-45"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mixed endianness setup is not supported!&quot;</span></span><span>
</span><span id="line-46"></span><span>                </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="annot"><a href="GHCi.CreateBCO.html#createBCO"><span class="hs-identifier hs-var">createBCO</span></a></span><span> </span><span id="local-6989586621679096642"><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096642"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679096641"><span class="annot"><span class="annottext">ResolvedBCO
</span><a href="#local-6989586621679096641"><span class="hs-identifier hs-var">bco</span></a></span></span><span>
</span><span id="line-48"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679096640"><span class="annot"><span class="annottext">BCO
</span><a href="#local-6989586621679096640"><span class="hs-identifier hs-var">linked_bco</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array Int HValue -&gt; ResolvedBCO -&gt; IO BCO
</span><a href="GHCi.CreateBCO.html#linkBCO%27"><span class="hs-identifier hs-var">linkBCO'</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096642"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">ResolvedBCO
</span><a href="#local-6989586621679096641"><span class="hs-identifier hs-var">bco</span></a></span><span>
</span><span id="line-49"></span><span>        </span><span class="hs-comment">-- Note [Updatable CAF BCOs]</span><span>
</span><span id="line-50"></span><span>        </span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-51"></span><span>        </span><span class="hs-comment">-- Why do we need mkApUpd0 here?  Otherwise top-level</span><span>
</span><span id="line-52"></span><span>        </span><span class="hs-comment">-- interpreted CAFs don't get updated after evaluation.  A</span><span>
</span><span id="line-53"></span><span>        </span><span class="hs-comment">-- top-level BCO will evaluate itself and return its value</span><span>
</span><span id="line-54"></span><span>        </span><span class="hs-comment">-- when entered, but it won't update itself.  Wrapping the BCO</span><span>
</span><span id="line-55"></span><span>        </span><span class="hs-comment">-- in an AP_UPD thunk will take care of the update for us.</span><span>
</span><span id="line-56"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-57"></span><span>        </span><span class="hs-comment">-- Furthermore:</span><span>
</span><span id="line-58"></span><span>        </span><span class="hs-comment">--   (a) An AP thunk *must* point directly to a BCO</span><span>
</span><span id="line-59"></span><span>        </span><span class="hs-comment">--   (b) A zero-arity BCO *must* be wrapped in an AP thunk</span><span>
</span><span id="line-60"></span><span>        </span><span class="hs-comment">--   (c) An AP is always fully saturated, so we *can't* wrap</span><span>
</span><span id="line-61"></span><span>        </span><span class="hs-comment">--       non-zero arity BCOs in an AP thunk.</span><span>
</span><span id="line-62"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-63"></span><span>        </span><span class="hs-comment">-- See #17424.</span><span>
</span><span id="line-64"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ResolvedBCO -&gt; Int
</span><a href="GHCi.ResolvedBCO.html#resolvedBCOArity"><span class="hs-identifier hs-var hs-var">resolvedBCOArity</span></a></span><span> </span><span class="annot"><span class="annottext">ResolvedBCO
</span><a href="#local-6989586621679096641"><span class="hs-identifier hs-var">bco</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">HValue -&gt; IO HValue
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Any -&gt; HValue
</span><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-var">HValue</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BCO -&gt; Any
forall a b. a -&gt; b
</span><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce"><span class="hs-identifier hs-var">unsafeCoerce</span></a></span><span> </span><span class="annot"><span class="annottext">BCO
</span><a href="#local-6989586621679096640"><span class="hs-identifier hs-var">linked_bco</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">BCO -&gt; (# Any #)
forall a. BCO -&gt; (# a #)
</span><span class="hs-identifier hs-var">mkApUpd0#</span></span><span> </span><span class="annot"><span class="annottext">BCO
</span><a href="#local-6989586621679096640"><span class="hs-identifier hs-var">linked_bco</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679096636"><span class="annot"><span class="annottext">Any
</span><a href="#local-6989586621679096636"><span class="hs-identifier hs-var">final_bco</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-67"></span><span>                  </span><span class="annot"><span class="annottext">HValue -&gt; IO HValue
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Any -&gt; HValue
</span><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-var">HValue</span></a></span><span> </span><span class="annot"><span class="annottext">Any
</span><a href="#local-6989586621679096636"><span class="hs-identifier hs-var">final_bco</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="annot"><a href="GHCi.CreateBCO.html#toWordArray"><span class="hs-identifier hs-type">toWordArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.Base.html#UArray"><span class="hs-identifier hs-type">UArray</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.Base.html#UArray"><span class="hs-identifier hs-type">UArray</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span>
</span><span id="line-71"></span><span id="toWordArray"><span class="annot"><span class="annottext">toWordArray :: UArray Int Word64 -&gt; UArray Int Word
</span><a href="GHCi.CreateBCO.html#toWordArray"><span class="hs-identifier hs-var hs-var">toWordArray</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word64 -&gt; Word) -&gt; UArray Int Word64 -&gt; UArray Int Word
forall (a :: * -&gt; * -&gt; *) e' e i.
(IArray a e', IArray a e, Ix i) =&gt;
(e' -&gt; e) -&gt; a i e' -&gt; a i e
</span><a href="../../array/src/Data.Array.Base.html#amap"><span class="hs-identifier hs-var">amap</span></a></span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Word
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span class="annot"><a href="GHCi.CreateBCO.html#linkBCO%27"><span class="hs-identifier hs-type">linkBCO'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCO"><span class="hs-identifier hs-type">ResolvedBCO</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">BCO</span></span><span>
</span><span id="line-74"></span><span id="linkBCO%27"><span class="annot"><span class="annottext">linkBCO' :: Array Int HValue -&gt; ResolvedBCO -&gt; IO BCO
</span><a href="GHCi.CreateBCO.html#linkBCO%27"><span class="hs-identifier hs-var hs-var">linkBCO'</span></a></span></span><span> </span><span id="local-6989586621679096633"><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096633"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCO"><span class="hs-identifier hs-type">ResolvedBCO</span></a></span><span class="hs-special">{</span><span id="local-6989586621679096627"><span id="local-6989586621679096628"><span id="local-6989586621679096629"><span id="local-6989586621679096630"><span id="local-6989586621679096631"><span id="local-6989586621679096632"><span class="annot"><span class="annottext">Bool
Int
UArray Int Word16
UArray Int Word64
SizedSeq ResolvedBCOPtr
resolvedBCOPtrs :: SizedSeq ResolvedBCOPtr
resolvedBCOLits :: UArray Int Word64
resolvedBCOBitmap :: UArray Int Word64
resolvedBCOInstrs :: UArray Int Word16
resolvedBCOArity :: Int
resolvedBCOIsLE :: Bool
resolvedBCOPtrs :: ResolvedBCO -&gt; SizedSeq ResolvedBCOPtr
resolvedBCOLits :: ResolvedBCO -&gt; UArray Int Word64
resolvedBCOIsLE :: ResolvedBCO -&gt; Bool
resolvedBCOInstrs :: ResolvedBCO -&gt; UArray Int Word16
resolvedBCOBitmap :: ResolvedBCO -&gt; UArray Int Word64
resolvedBCOArity :: ResolvedBCO -&gt; Int
</span><a href="#local-6989586621679096627"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-75"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-76"></span><span>      </span><span id="local-6989586621679096626"><span class="annot"><span class="annottext">ptrs :: [ResolvedBCOPtr]
</span><a href="#local-6989586621679096626"><span class="hs-identifier hs-var hs-var">ptrs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SizedSeq ResolvedBCOPtr -&gt; [ResolvedBCOPtr]
forall a. SizedSeq a -&gt; [a]
</span><a href="SizedSeq.html#ssElts"><span class="hs-identifier hs-var">ssElts</span></a></span><span> </span><span class="annot"><span class="annottext">SizedSeq ResolvedBCOPtr
</span><a href="#local-6989586621679096627"><span class="hs-identifier hs-var">resolvedBCOPtrs</span></a></span><span>
</span><span id="line-77"></span><span>      </span><span id="local-6989586621679096624"><span class="annot"><span class="annottext">n_ptrs :: Word
</span><a href="#local-6989586621679096624"><span class="hs-identifier hs-var hs-var">n_ptrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SizedSeq ResolvedBCOPtr -&gt; Word
forall a. SizedSeq a -&gt; Word
</span><a href="SizedSeq.html#sizeSS"><span class="hs-identifier hs-var">sizeSS</span></a></span><span> </span><span class="annot"><span class="annottext">SizedSeq ResolvedBCOPtr
</span><a href="#local-6989586621679096627"><span class="hs-identifier hs-var">resolvedBCOPtrs</span></a></span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>      </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621679096622"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096622"><span class="hs-identifier hs-var">arity#</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096631"><span class="hs-identifier hs-var">resolvedBCOArity</span></a></span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span>      </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHCi.CreateBCO.html#EmptyArr"><span class="hs-identifier hs-type">EmptyArr</span></a></span><span> </span><span id="local-6989586621679096620"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096620"><span class="hs-identifier hs-var">empty#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EmptyArr
</span><a href="GHCi.CreateBCO.html#emptyArr"><span class="hs-identifier hs-var">emptyArr</span></a></span><span> </span><span class="hs-comment">-- See Note [BCO empty array]</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>      </span><span id="local-6989586621679096615"><span class="annot"><span class="annottext">barr :: UArray i e -&gt; ByteArray#
</span><a href="#local-6989586621679096615"><span class="hs-identifier hs-var hs-var">barr</span></a></span></span><span> </span><span id="local-6989586621679096614"><span class="annot"><span class="annottext">UArray i e
</span><a href="#local-6989586621679096614"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UArray i e
</span><a href="#local-6989586621679096614"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.Base.html#UArray"><span class="hs-identifier hs-type">UArray</span></a></span><span> </span><span id="local-6989586621679096612"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679096612"><span class="hs-identifier hs-var">_lo</span></a></span></span><span> </span><span id="local-6989586621679096611"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679096611"><span class="hs-identifier hs-var">_hi</span></a></span></span><span> </span><span id="local-6989586621679096610"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096610"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679096609"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096609"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096610"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096620"><span class="hs-identifier hs-var">empty#</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096609"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-84"></span><span>      </span><span id="local-6989586621679096608"><span class="annot"><span class="annottext">insns_barr :: ByteArray#
</span><a href="#local-6989586621679096608"><span class="hs-identifier hs-var hs-var">insns_barr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UArray Int Word16 -&gt; ByteArray#
forall {i} {e}. UArray i e -&gt; ByteArray#
</span><a href="#local-6989586621679096615"><span class="hs-identifier hs-var">barr</span></a></span><span> </span><span class="annot"><span class="annottext">UArray Int Word16
</span><a href="#local-6989586621679096630"><span class="hs-identifier hs-var">resolvedBCOInstrs</span></a></span><span>
</span><span id="line-85"></span><span>      </span><span id="local-6989586621679096607"><span class="annot"><span class="annottext">bitmap_barr :: ByteArray#
</span><a href="#local-6989586621679096607"><span class="hs-identifier hs-var hs-var">bitmap_barr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UArray Int Word -&gt; ByteArray#
forall {i} {e}. UArray i e -&gt; ByteArray#
</span><a href="#local-6989586621679096615"><span class="hs-identifier hs-var">barr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UArray Int Word64 -&gt; UArray Int Word
</span><a href="GHCi.CreateBCO.html#toWordArray"><span class="hs-identifier hs-var">toWordArray</span></a></span><span> </span><span class="annot"><span class="annottext">UArray Int Word64
</span><a href="#local-6989586621679096629"><span class="hs-identifier hs-var">resolvedBCOBitmap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>      </span><span id="local-6989586621679096606"><span class="annot"><span class="annottext">literals_barr :: ByteArray#
</span><a href="#local-6989586621679096606"><span class="hs-identifier hs-var hs-var">literals_barr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UArray Int Word -&gt; ByteArray#
forall {i} {e}. UArray i e -&gt; ByteArray#
</span><a href="#local-6989586621679096615"><span class="hs-identifier hs-var">barr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UArray Int Word64 -&gt; UArray Int Word
</span><a href="GHCi.CreateBCO.html#toWordArray"><span class="hs-identifier hs-var">toWordArray</span></a></span><span> </span><span class="annot"><span class="annottext">UArray Int Word64
</span><a href="#local-6989586621679096628"><span class="hs-identifier hs-var">resolvedBCOLits</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span>  </span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span id="local-6989586621679096604"><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096604"><span class="hs-identifier hs-var">marr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array Int HValue -&gt; Word -&gt; [ResolvedBCOPtr] -&gt; IO PtrsArr
</span><a href="GHCi.CreateBCO.html#mkPtrsArray"><span class="hs-identifier hs-var">mkPtrsArray</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096633"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621679096624"><span class="hs-identifier hs-var">n_ptrs</span></a></span><span> </span><span class="annot"><span class="annottext">[ResolvedBCOPtr]
</span><a href="#local-6989586621679096626"><span class="hs-identifier hs-var">ptrs</span></a></span><span>
</span><span id="line-89"></span><span>  </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, BCO #)) -&gt; IO BCO
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, BCO #)) -&gt; IO BCO)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, BCO #)) -&gt; IO BCO
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096602"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096602"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-90"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
-&gt; State# RealWorld -&gt; (# State# RealWorld, Array# HValue #)
forall d a.
MutableArray# d a -&gt; State# d -&gt; (# State# d, Array# a #)
</span><span class="hs-identifier hs-var">unsafeFreezeArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096604"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096602"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679096601"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096601"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679096600"><span class="annot"><span class="annottext">Array# HValue
</span><a href="#local-6989586621679096600"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-91"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteArray#
-&gt; ByteArray# -&gt; Array# HValue -&gt; Int# -&gt; ByteArray# -&gt; IO BCO
forall a.
ByteArray#
-&gt; ByteArray# -&gt; Array# a -&gt; Int# -&gt; ByteArray# -&gt; IO BCO
</span><a href="GHCi.CreateBCO.html#newBCO"><span class="hs-identifier hs-var">newBCO</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096608"><span class="hs-identifier hs-var">insns_barr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096606"><span class="hs-identifier hs-var">literals_barr</span></a></span><span> </span><span class="annot"><span class="annottext">Array# HValue
</span><a href="#local-6989586621679096600"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096622"><span class="hs-identifier hs-var">arity#</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096607"><span class="hs-identifier hs-var">bitmap_barr</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span id="local-6989586621679096598"><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, BCO #)
</span><a href="#local-6989586621679096598"><span class="hs-identifier hs-var">io</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-92"></span><span>    </span><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, BCO #)
</span><a href="#local-6989586621679096598"><span class="hs-identifier hs-var">io</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096601"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- we recursively link any sub-BCOs while making the ptrs array</span><span>
</span><span id="line-97"></span><span class="annot"><a href="GHCi.CreateBCO.html#mkPtrsArray"><span class="hs-identifier hs-type">mkPtrsArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCOPtr"><span class="hs-identifier hs-type">ResolvedBCOPtr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span>
</span><span id="line-98"></span><span id="mkPtrsArray"><span class="annot"><span class="annottext">mkPtrsArray :: Array Int HValue -&gt; Word -&gt; [ResolvedBCOPtr] -&gt; IO PtrsArr
</span><a href="GHCi.CreateBCO.html#mkPtrsArray"><span class="hs-identifier hs-var hs-var">mkPtrsArray</span></a></span></span><span> </span><span id="local-6989586621679096597"><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096597"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679096596"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621679096596"><span class="hs-identifier hs-var">n_ptrs</span></a></span></span><span> </span><span id="local-6989586621679096595"><span class="annot"><span class="annottext">[ResolvedBCOPtr]
</span><a href="#local-6989586621679096595"><span class="hs-identifier hs-var">ptrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-99"></span><span>  </span><span id="local-6989586621679096594"><span class="annot"><span class="annottext">PtrsArr
</span><a href="#local-6989586621679096594"><span class="hs-identifier hs-var">marr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO PtrsArr
</span><a href="GHCi.CreateBCO.html#newPtrsArray"><span class="hs-identifier hs-var">newPtrsArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621679096596"><span class="hs-identifier hs-var">n_ptrs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621679096587"><span class="annot"><span class="annottext">fill :: ResolvedBCOPtr -&gt; Int -&gt; IO ()
</span><a href="#local-6989586621679096587"><span class="hs-identifier hs-var hs-var">fill</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCORef"><span class="hs-identifier hs-type">ResolvedBCORef</span></a></span><span> </span><span id="local-6989586621679096585"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096585"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096584"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096584"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-102"></span><span>      </span><span class="annot"><span class="annottext">Int -&gt; HValue -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayHValue"><span class="hs-identifier hs-var">writePtrsArrayHValue</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096584"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096597"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int HValue -&gt; Int -&gt; HValue
forall (a :: * -&gt; * -&gt; *) e i.
(IArray a e, Ix i) =&gt;
a i e -&gt; i -&gt; e
</span><a href="../../array/src/Data.Array.Base.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096585"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">PtrsArr
</span><a href="#local-6989586621679096594"><span class="hs-identifier hs-var">marr</span></a></span><span>  </span><span class="hs-comment">-- must be lazy!</span><span>
</span><span id="line-103"></span><span>    </span><span class="annot"><a href="#local-6989586621679096587"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCOPtr"><span class="hs-identifier hs-type">ResolvedBCOPtr</span></a></span><span> </span><span id="local-6989586621679096580"><span class="annot"><span class="annottext">HValueRef
</span><a href="#local-6989586621679096580"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096579"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096579"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-104"></span><span>      </span><span id="local-6989586621679096578"><span class="annot"><span class="annottext">HValue
</span><a href="#local-6989586621679096578"><span class="hs-identifier hs-var">hv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HValueRef -&gt; IO HValue
forall a. RemoteRef a -&gt; IO a
</span><a href="GHCi.RemoteTypes.html#localRef"><span class="hs-identifier hs-var">localRef</span></a></span><span> </span><span class="annot"><span class="annottext">HValueRef
</span><a href="#local-6989586621679096580"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-105"></span><span>      </span><span class="annot"><span class="annottext">Int -&gt; HValue -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayHValue"><span class="hs-identifier hs-var">writePtrsArrayHValue</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096579"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">HValue
</span><a href="#local-6989586621679096578"><span class="hs-identifier hs-var">hv</span></a></span><span> </span><span class="annot"><span class="annottext">PtrsArr
</span><a href="#local-6989586621679096594"><span class="hs-identifier hs-var">marr</span></a></span><span>
</span><span id="line-106"></span><span>    </span><span class="annot"><a href="#local-6989586621679096587"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCOStaticPtr"><span class="hs-identifier hs-type">ResolvedBCOStaticPtr</span></a></span><span> </span><span id="local-6989586621679096575"><span class="annot"><span class="annottext">RemotePtr ()
</span><a href="#local-6989586621679096575"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096574"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096574"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-107"></span><span>      </span><span class="annot"><span class="annottext">Int -&gt; Ptr () -&gt; PtrsArr -&gt; IO ()
forall a. Int -&gt; Ptr a -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayPtr"><span class="hs-identifier hs-var">writePtrsArrayPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096574"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RemotePtr () -&gt; Ptr ()
forall a. RemotePtr a -&gt; Ptr a
</span><a href="GHCi.RemoteTypes.html#fromRemotePtr"><span class="hs-identifier hs-var">fromRemotePtr</span></a></span><span> </span><span class="annot"><span class="annottext">RemotePtr ()
</span><a href="#local-6989586621679096575"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">PtrsArr
</span><a href="#local-6989586621679096594"><span class="hs-identifier hs-var">marr</span></a></span><span>
</span><span id="line-108"></span><span>    </span><span class="annot"><a href="#local-6989586621679096587"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCOPtrBCO"><span class="hs-identifier hs-type">ResolvedBCOPtrBCO</span></a></span><span> </span><span id="local-6989586621679096570"><span class="annot"><span class="annottext">ResolvedBCO
</span><a href="#local-6989586621679096570"><span class="hs-identifier hs-var">bco</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096569"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096569"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-109"></span><span>      </span><span id="local-6989586621679096568"><span class="annot"><span class="annottext">BCO
</span><a href="#local-6989586621679096568"><span class="hs-identifier hs-var">bco</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array Int HValue -&gt; ResolvedBCO -&gt; IO BCO
</span><a href="GHCi.CreateBCO.html#linkBCO%27"><span class="hs-identifier hs-var">linkBCO'</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int HValue
</span><a href="#local-6989586621679096597"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">ResolvedBCO
</span><a href="#local-6989586621679096570"><span class="hs-identifier hs-var">bco</span></a></span><span>
</span><span id="line-110"></span><span>      </span><span class="annot"><span class="annottext">Int -&gt; BCO -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayBCO"><span class="hs-identifier hs-var">writePtrsArrayBCO</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096569"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">BCO
</span><a href="#local-6989586621679096568"><span class="hs-identifier hs-var">bco</span></a></span><span> </span><span class="annot"><span class="annottext">PtrsArr
</span><a href="#local-6989586621679096594"><span class="hs-identifier hs-var">marr</span></a></span><span>
</span><span id="line-111"></span><span>    </span><span class="annot"><a href="#local-6989586621679096587"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.ResolvedBCO.html#ResolvedBCOPtrBreakArray"><span class="hs-identifier hs-type">ResolvedBCOPtrBreakArray</span></a></span><span> </span><span id="local-6989586621679096565"><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621679096565"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096564"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096564"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-112"></span><span>      </span><span class="annot"><a href="GHCi.BreakArray.html#BA"><span class="hs-identifier hs-type">BA</span></a></span><span> </span><span id="local-6989586621679096562"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621679096562"><span class="hs-identifier hs-var">mba</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RemoteRef BreakArray -&gt; IO BreakArray
forall a. RemoteRef a -&gt; IO a
</span><a href="GHCi.RemoteTypes.html#localRef"><span class="hs-identifier hs-var">localRef</span></a></span><span> </span><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621679096565"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-113"></span><span>      </span><span class="annot"><span class="annottext">Int -&gt; MutableByteArray# RealWorld -&gt; PtrsArr -&gt; IO ()
forall s. Int -&gt; MutableByteArray# s -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayMBA"><span class="hs-identifier hs-var">writePtrsArrayMBA</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679096564"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621679096562"><span class="hs-identifier hs-var">mba</span></a></span><span> </span><span class="annot"><span class="annottext">PtrsArr
</span><a href="#local-6989586621679096594"><span class="hs-identifier hs-var">marr</span></a></span><span>
</span><span id="line-114"></span><span>  </span><span class="annot"><span class="annottext">(ResolvedBCOPtr -&gt; Int -&gt; IO ())
-&gt; [ResolvedBCOPtr] -&gt; [Int] -&gt; IO ()
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; b -&gt; m c) -&gt; [a] -&gt; [b] -&gt; m ()
</span><a href="../../base/src/Control.Monad.html#zipWithM_"><span class="hs-identifier hs-var">zipWithM_</span></a></span><span> </span><span class="annot"><span class="annottext">ResolvedBCOPtr -&gt; Int -&gt; IO ()
</span><a href="#local-6989586621679096587"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">[ResolvedBCOPtr]
</span><a href="#local-6989586621679096595"><span class="hs-identifier hs-var">ptrs</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span>
</span><span id="line-115"></span><span>  </span><span class="annot"><span class="annottext">PtrsArr -&gt; IO PtrsArr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">PtrsArr
</span><a href="#local-6989586621679096594"><span class="hs-identifier hs-var">marr</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="hs-keyword">data</span><span> </span><span id="PtrsArr"><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-var">PtrsArr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PtrsArr"><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-var">PtrsArr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">MutableArray#</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">RealWorld</span></span><span> </span><span class="annot"><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHCi.CreateBCO.html#newPtrsArray"><span class="hs-identifier hs-type">newPtrsArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span>
</span><span id="line-120"></span><span id="newPtrsArray"><span class="annot"><span class="annottext">newPtrsArray :: Int -&gt; IO PtrsArr
</span><a href="GHCi.CreateBCO.html#newPtrsArray"><span class="hs-identifier hs-var hs-var">newPtrsArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621679096559"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096559"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, PtrsArr #)) -&gt; IO PtrsArr
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, PtrsArr #))
 -&gt; IO PtrsArr)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, PtrsArr #))
-&gt; IO PtrsArr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096558"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096558"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-121"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; HValue
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableArray# RealWorld HValue #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><span class="hs-identifier hs-var">newArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096559"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">HValue
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096558"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679096556"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096556"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679096555"><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096555"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096556"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue -&gt; PtrsArr
</span><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-var">PtrsArr</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096555"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="annot"><a href="GHCi.CreateBCO.html#writePtrsArrayHValue"><span class="hs-identifier hs-type">writePtrsArrayHValue</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span id="writePtrsArrayHValue"><span class="annot"><span class="annottext">writePtrsArrayHValue :: Int -&gt; HValue -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayHValue"><span class="hs-identifier hs-var hs-var">writePtrsArrayHValue</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621679096554"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096554"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096553"><span class="annot"><span class="annottext">HValue
</span><a href="#local-6989586621679096553"><span class="hs-identifier hs-var">hv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span id="local-6989586621679096552"><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096552"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096551"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096551"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-125"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
-&gt; Int# -&gt; HValue -&gt; State# RealWorld -&gt; State# RealWorld
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096552"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096554"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">HValue
</span><a href="#local-6989586621679096553"><span class="hs-identifier hs-var">hv</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096551"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span id="local-6989586621679096550"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096550"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096550"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span id="local-6989586621679096746"><span class="annot"><a href="GHCi.CreateBCO.html#writePtrsArrayPtr"><span class="hs-identifier hs-type">writePtrsArrayPtr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679096746"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-128"></span><span id="writePtrsArrayPtr"><span class="annot"><span class="annottext">writePtrsArrayPtr :: forall a. Int -&gt; Ptr a -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayPtr"><span class="hs-identifier hs-var hs-var">writePtrsArrayPtr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621679096549"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096549"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621679096547"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679096547"><span class="hs-identifier hs-var">a#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span id="local-6989586621679096546"><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096546"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096545"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096545"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-129"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
-&gt; Int# -&gt; Addr# -&gt; State# RealWorld -&gt; State# RealWorld
forall s a.
MutableArray# s a -&gt; Int# -&gt; Addr# -&gt; State# s -&gt; State# s
</span><a href="GHCi.CreateBCO.html#writeArrayAddr%23"><span class="hs-identifier hs-var">writeArrayAddr#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096546"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096549"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679096547"><span class="hs-identifier hs-var">a#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096545"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span id="local-6989586621679096543"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096543"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096543"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="hs-comment">-- This is rather delicate: convincing GHC to pass an Addr# as an Any but</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- without making a thunk turns out to be surprisingly tricky.</span><span>
</span><span id="line-133"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#writeArrayAddr%23"><span class="hs-pragma hs-type">writeArrayAddr#</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-134"></span><span id="local-6989586621679096734"><span id="local-6989586621679096735"><span class="annot"><a href="GHCi.CreateBCO.html#writeArrayAddr%23"><span class="hs-identifier hs-type">writeArrayAddr#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">MutableArray#</span></span><span> </span><span class="annot"><a href="#local-6989586621679096735"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679096734"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Addr#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">State#</span></span><span> </span><span class="annot"><a href="#local-6989586621679096735"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">State#</span></span><span> </span><span class="annot"><a href="#local-6989586621679096735"><span class="hs-identifier hs-type">s</span></a></span></span></span><span>
</span><span id="line-135"></span><span id="writeArrayAddr%23"><span class="annot"><span class="annottext">writeArrayAddr# :: forall s a.
MutableArray# s a -&gt; Int# -&gt; Addr# -&gt; State# s -&gt; State# s
</span><a href="GHCi.CreateBCO.html#writeArrayAddr%23"><span class="hs-identifier hs-var hs-var">writeArrayAddr#</span></a></span></span><span> </span><span id="local-6989586621679096542"><span class="annot"><span class="annottext">MutableArray# s a
</span><a href="#local-6989586621679096542"><span class="hs-identifier hs-var">marr</span></a></span></span><span> </span><span id="local-6989586621679096541"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096541"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679096540"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679096540"><span class="hs-identifier hs-var">addr</span></a></span></span><span> </span><span id="local-6989586621679096539"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679096539"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(MutableArray# Any Any -&gt; Int# -&gt; Any -&gt; State# Any -&gt; State# Any)
-&gt; MutableArray# s a -&gt; Int# -&gt; Addr# -&gt; State# s -&gt; State# s
</span><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce%23"><span class="hs-identifier hs-var">unsafeCoerce#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# Any Any -&gt; Int# -&gt; Any -&gt; State# Any -&gt; State# Any
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# s a
</span><a href="#local-6989586621679096542"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096541"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679096540"><span class="hs-identifier hs-var">addr</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679096539"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="annot"><a href="GHCi.CreateBCO.html#writePtrsArrayBCO"><span class="hs-identifier hs-type">writePtrsArrayBCO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">BCO</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-138"></span><span id="writePtrsArrayBCO"><span class="annot"><span class="annottext">writePtrsArrayBCO :: Int -&gt; BCO -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayBCO"><span class="hs-identifier hs-var hs-var">writePtrsArrayBCO</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621679096538"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096538"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096537"><span class="annot"><span class="annottext">BCO
</span><a href="#local-6989586621679096537"><span class="hs-identifier hs-var">bco</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span id="local-6989586621679096536"><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096536"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096535"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096535"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(MutableArray# Any Any -&gt; Int# -&gt; Any -&gt; State# Any -&gt; State# Any)
-&gt; MutableArray# RealWorld HValue
-&gt; Int#
-&gt; BCO
-&gt; State# RealWorld
-&gt; State# RealWorld
</span><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce%23"><span class="hs-identifier hs-var">unsafeCoerce#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# Any Any -&gt; Int# -&gt; Any -&gt; State# Any -&gt; State# Any
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeArray#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096536"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096538"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">BCO
</span><a href="#local-6989586621679096537"><span class="hs-identifier hs-var">bco</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096535"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span id="local-6989586621679096534"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096534"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096534"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span id="local-6989586621679096743"><span class="annot"><a href="GHCi.CreateBCO.html#writePtrsArrayMBA"><span class="hs-identifier hs-type">writePtrsArrayMBA</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">MutableByteArray#</span></span><span> </span><span class="annot"><a href="#local-6989586621679096743"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-142"></span><span id="writePtrsArrayMBA"><span class="annot"><span class="annottext">writePtrsArrayMBA :: forall s. Int -&gt; MutableByteArray# s -&gt; PtrsArr -&gt; IO ()
</span><a href="GHCi.CreateBCO.html#writePtrsArrayMBA"><span class="hs-identifier hs-var hs-var">writePtrsArrayMBA</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621679096533"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096533"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679096532"><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621679096532"><span class="hs-identifier hs-var">mba</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHCi.CreateBCO.html#PtrsArr"><span class="hs-identifier hs-type">PtrsArr</span></a></span><span> </span><span id="local-6989586621679096531"><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096531"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096530"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096530"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-143"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(MutableArray# Any Any -&gt; Int# -&gt; Any -&gt; State# Any -&gt; State# Any)
-&gt; MutableArray# RealWorld HValue
-&gt; Int#
-&gt; MutableByteArray# s
-&gt; State# RealWorld
-&gt; State# RealWorld
</span><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce%23"><span class="hs-identifier hs-var">unsafeCoerce#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# Any Any -&gt; Int# -&gt; Any -&gt; State# Any -&gt; State# Any
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeArray#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld HValue
</span><a href="#local-6989586621679096531"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096533"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621679096532"><span class="hs-identifier hs-var">mba</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096530"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span id="local-6989586621679096529"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096529"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096529"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span id="local-6989586621679096752"><span class="annot"><a href="GHCi.CreateBCO.html#newBCO"><span class="hs-identifier hs-type">newBCO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">ByteArray#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">ByteArray#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Array#</span></span><span> </span><span class="annot"><a href="#local-6989586621679096752"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">ByteArray#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">BCO</span></span></span><span>
</span><span id="line-146"></span><span id="newBCO"><span class="annot"><span class="annottext">newBCO :: forall a.
ByteArray#
-&gt; ByteArray# -&gt; Array# a -&gt; Int# -&gt; ByteArray# -&gt; IO BCO
</span><a href="GHCi.CreateBCO.html#newBCO"><span class="hs-identifier hs-var hs-var">newBCO</span></a></span></span><span> </span><span id="local-6989586621679096528"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096528"><span class="hs-identifier hs-var">instrs</span></a></span></span><span> </span><span id="local-6989586621679096527"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096527"><span class="hs-identifier hs-var">lits</span></a></span></span><span> </span><span id="local-6989586621679096526"><span class="annot"><span class="annottext">Array# a
</span><a href="#local-6989586621679096526"><span class="hs-identifier hs-var">ptrs</span></a></span></span><span> </span><span id="local-6989586621679096525"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096525"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span id="local-6989586621679096524"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096524"><span class="hs-identifier hs-var">bitmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, BCO #)) -&gt; IO BCO
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, BCO #)) -&gt; IO BCO)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, BCO #)) -&gt; IO BCO
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096523"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096523"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-147"></span><span>  </span><span class="annot"><span class="annottext">ByteArray#
-&gt; ByteArray#
-&gt; Array# a
-&gt; Int#
-&gt; ByteArray#
-&gt; State# RealWorld
-&gt; (# State# RealWorld, BCO #)
forall a d.
ByteArray#
-&gt; ByteArray#
-&gt; Array# a
-&gt; Int#
-&gt; ByteArray#
-&gt; State# d
-&gt; (# State# d, BCO #)
</span><span class="hs-identifier hs-var">newBCO#</span></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096528"><span class="hs-identifier hs-var">instrs</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096527"><span class="hs-identifier hs-var">lits</span></a></span><span> </span><span class="annot"><span class="annottext">Array# a
</span><a href="#local-6989586621679096526"><span class="hs-identifier hs-var">ptrs</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679096525"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096524"><span class="hs-identifier hs-var">bitmap</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096523"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="hs-comment">{- Note [BCO empty array]
   ~~~~~~~~~~~~~~~~~~~~~~
Lots of BCOs have empty ptrs or nptrs, but empty arrays are not free:
they are 2-word heap objects.  So let's make a single empty array and
share it between all BCOs.
-}</span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="hs-keyword">data</span><span> </span><span id="EmptyArr"><span class="annot"><a href="GHCi.CreateBCO.html#EmptyArr"><span class="hs-identifier hs-var">EmptyArr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="EmptyArr"><span class="annot"><a href="GHCi.CreateBCO.html#EmptyArr"><span class="hs-identifier hs-var">EmptyArr</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">ByteArray#</span></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#emptyArr"><span class="hs-pragma hs-type">emptyArr</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-159"></span><span class="annot"><a href="GHCi.CreateBCO.html#emptyArr"><span class="hs-identifier hs-type">emptyArr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHCi.CreateBCO.html#EmptyArr"><span class="hs-identifier hs-type">EmptyArr</span></a></span><span>
</span><span id="line-160"></span><span id="emptyArr"><span class="annot"><span class="annottext">emptyArr :: EmptyArr
</span><a href="GHCi.CreateBCO.html#emptyArr"><span class="hs-identifier hs-var hs-var">emptyArr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO EmptyArr -&gt; EmptyArr
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO EmptyArr -&gt; EmptyArr) -&gt; IO EmptyArr -&gt; EmptyArr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, EmptyArr #))
-&gt; IO EmptyArr
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, EmptyArr #))
 -&gt; IO EmptyArr)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, EmptyArr #))
-&gt; IO EmptyArr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679096521"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096521"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableByteArray# RealWorld #)
forall d. Int# -&gt; State# d -&gt; (# State# d, MutableByteArray# d #)
</span><span class="hs-identifier hs-var">newByteArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096521"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679096520"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096520"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679096519"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621679096519"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-162"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
-&gt; State# RealWorld -&gt; (# State# RealWorld, ByteArray# #)
forall d.
MutableByteArray# d -&gt; State# d -&gt; (# State# d, ByteArray# #)
</span><span class="hs-identifier hs-var">unsafeFreezeByteArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621679096519"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096520"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679096518"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096518"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679096517"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096517"><span class="hs-identifier hs-var">farr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679096518"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; EmptyArr
</span><a href="GHCi.CreateBCO.html#EmptyArr"><span class="hs-identifier hs-var">EmptyArr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679096517"><span class="hs-identifier hs-var">farr</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-165"></span></pre></body></html>